import { useAccount } from '@/store/user'
import React, { ReactNode } from 'react'
import { Navigate } from 'react-router-dom'

type Props = {
    children:ReactNode
}

export default function RequireAuth({children}: Props) {
  const {userInfo} = useAccount()
  // let isLogin = true  //模拟登录状态
  return (
    <div>
        {userInfo?children:<Navigate to="/login"/>}
    </div>
  )
}